<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>四川省工程建设领域项目信息、信用信息公开维护平台</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/main.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/My97DatePicker4/WdatePicker.js"></script>
<script src="<%=request.getContextPath()%>/scripts/jquery-latest.pack.js"></script>
<script type="text/javascript">
function check(f){

	if (f.departmentName.value == ""){
		alert("必须填写部门名称");
		f.departmentName.focus();
		return false;
	}

	if (f.areaCode.value == ""){
		alert("必须选择部门所属行政区划");
		f.areaCode.focus();
		return false;
	}

	if (f.topDep.value == ""){
		alert("必须选择隶属于国家部委");
		f.topDep.focus();
		return false;
	}
	
	if (f.userAccount.value == ""){
		alert("必须填写帐号");
		f.userAccount.focus();
		return false;
	}

	if (f.userPassword.value == ""){
		alert("必须填写密码");
		f.userPassword.focus();
		return false;
	}

	if (f.contacter.value == ""){
		alert("必须填写联系人");
		f.contacter.focus();
		return false;
	}
	
	if (f.phone.value == ""){
		alert("必须填写联系电话");
		f.phone.focus();
		return false;
	}

	if (f.email.value == ""){
		alert("必须填写电子邮件地址");
		f.email.focus();
		return false;
	}

}

function checkAccount(obj)
{
	if (obj.value != "")
	{
		setTimeout(function(){checkAccountDB(obj);}, 2000);
	}
}
function checkAccountDB(obj)
{
	var options={type:"POST", 
				url:"<%=request.getContextPath()%>/user/accountAuth?account="+obj.value, 
				dataType:"json", success: resultResponse};
	$.ajax(options);
}
function resultResponse(data,status) {
	var obj = document.getElementById("acr");
	if(status){
		if (data.result == 0){
			obj.innerHTML='<font color="#669933">本帐号可以使用</font>';
		}
		else{
			obj.innerHTML='<font color="#FF9966">本帐号已存在</font>';
		}
	}
	else{
		obj.innerHTML='<font color="#FFFF00">无法检测帐号</font>';
	}
}

function init() {

	var date = new Date();
	var s;
	s = date.toLocaleString();
	document.getElementById("datetext").innerHTML = s.substring(0, 10)
			+ "  试用版 V1.0";

}

</script>
</head>
<body onload="init()">
<form method="post" action="<%=request.getContextPath()%>/Monitor/depAccReg" onsubmit="return check(this);">

<table class="top">
  <tr>
    <td width="40" class="topl"></td>
    <td width="840"><div class="plat_title"><img src="<%=request.getContextPath()%>/images/toptitle.gif" /></div></td>
    <td width="21"><a href="#" class="top_drop_btn"></a></td>
    <td width="20"><a href="#" class="maxbtn"></a></td>
    <td width="29"><a href="#" class="closebtn"></a></td>
  </tr>
</table>
<table class="content">
  <tr>
    <td class="main_l"></td>
    <td class="main_lbar"></td>
    <td width="918" valign="top">
	<div class="banner"><img src="<%=request.getContextPath()%>/images/banner.jpg" /></div>
	
	<div class="change"><span style="float:left">&nbsp;&nbsp;欢迎 ${logonUserInfo.userName}</span><span id="datetext"></span></div>
	
	<div style="font-size: 14px;color:#006ab7;"><h5><a style="color:#006ab7;text-decoration:none;" 
	href="<c:url value='/views/monitor/welcome.jsp'/>">&nbsp;&nbsp;首页</a> >> ${isSub==1?"下级经信委帐号分配":"审批部门帐号分配"}</h5></div>
	
	<div class="op_con">
    <table class="regtable">
  <tr>
<th colspan="2">审批用户注册</th>
  </tr>
  <tr>
  <td class="w02"></td>
  <td><span style="float:right;padding-right:140px"><b>*</b>为必填项</span></td>
  </tr>
  
  <tr>
    <td class="w02">部门名称</td>
    <td><input type="text" class="intt" name="departmentName"  maxlength="50"/><b>*</b><span>请输入完整的名称,包括地区名称</span></td>
  </tr>
  
  <input type="hidden" name="id" value="${isSub}" />
  
  <c:if test="${isSub==1}">
	 <tr>
	   <td class="w02">部门所属行政区划</td>
	   <td>
	    	<select name="areaCode" style="1px solid #CCC">
	    		<option value=""></option>
				<c:forEach items="${subAreaList}" var="subArea">
					<option value="${subArea.areaCode}">${subArea.areaName}</option>
				</c:forEach>
	    	</select>
	   <b>*</b><span>请选择该帐号所属部门对应的行政区划</span></td>
	</tr>
	<input type="hidden" name="topDep" value="001"></input>
  </c:if>
  
  <c:if test="${isSub==0}">
    <tr>
    <td class="w02">隶属于国家部委</td>
    <td><select name="topDep" style="1px solid #CCC">
    		<option value=""></option>
			<option value="002">国家发展和改革委员会</option>
			<option value="003">住房和城乡建设部</option>
			<option value="004">交通运输部</option>
			<option value="005">水利部</option>
			<option value="006">国土资源部</option>
		</select><b>*</b><span>请选择帐号所属部门的隶属国家部委</span>
	</td>
  </tr>
  	<input type="hidden" name="areaCode" value="${logonUserInfo.userAreaCode}"></input>
  </c:if>
  
  
  <tr>
    <td class="w02">部门地址</td>
    <td><input type="text" class="intt" name="companyAddr"  maxlength="50"/><span>请输入该帐号所属部门的详细地址</span></td>
  </tr>
  
  <tr>
    <td class="w02">帐号</td>
    <td><input type="text" class="intt"  name="userAccount" onblur="checkAccount(this)"/><b>*</b><span id="acr">用于登录的用户名</span></td>
  </tr>
  
    <tr>
    <td class="w02">初始密码</td>
    <td><input type="text" class="intt" name="userPassword"/><b>*</b><span>用于登录的密码，请区分大小写</span></td>
  </tr>
  
  <tr>
    <td class="w02">姓名</td>
    <td><input type="text" class="intt" name="userName"/><span>帐户使用者的姓名</span></td>
  </tr>

  <tr>
    <td class="w02">联系人</td>
    <td><input type="text" class="intt" name="contacter" maxlength="50"/><b>*</b><span>敏感信息将不会被公开</span></td>
  </tr>
  
  <tr>
    <td class="w02">联系电话</td>
    <td><input type="text" class="intt" name="phone" maxlength="50"/><b>*</b><span>敏感信息将不会被公开</span></td>
  </tr>
  
   <tr>
    <td class="w02">电子邮件</td>
    <td><input type="text" class="intt" name="email" maxlength="50"/><b>*</b><span>找回密码必填</span></td>
  </tr>
  
  
  
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="注册" class="btn40" />
    <input style="margin:0 0 0 5px;" type="reset" value="重置" class="btn40" /></td>
  </tr>
    <tr>
  <td colspan="2"></td>
  </tr>
</table>

	</div>
	</td>
    <td class="main_rbar"></td>
	<td class="main_r"></td>
  </tr>
</table>
</form>
<c:import url="foot.jsp" />
</body>
<c:import url="/foot.jsp"></c:import>
</html>
